﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Messaging ;

namespace CDistributed.Console
{
    class MsmqContainer
    {
        private const string queuePath = @".\private$\processMSMQ";
        private static MessageQueue queues;

        public static MessageQueue GetInstance()
        {
            if (!MessageQueue.Exists(queuePath))
                MessageQueue.Create(queuePath);
            if (queues == null)
                queues = new MessageQueue(queuePath);

            return queues;
        }
    }
}
